<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class execution_exception</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Test">
<link rel="up" href="../header/boost/test/execution_monitor_hpp.html" title="Header &lt;boost/test/execution_monitor.hpp&gt;">
<link rel="prev" href="execution_aborted.html" title="Class execution_aborted">
<link rel="next" href="execution_exception/location.html" title="Struct location">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="execution_aborted.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../header/boost/test/execution_monitor_hpp.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="execution_exception/location.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.execution_exception"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class execution_exception</span></h2>
<p>boost::execution_exception — This class is used to report any kind of an failure during execution of a monitored function inside of <a class="link" href="execution_monitor.html" title="Class execution_monitor">execution_monitor</a>. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../header/boost/test/execution_monitor_hpp.html" title="Header &lt;boost/test/execution_monitor.hpp&gt;">boost/test/execution_monitor.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="execution_exception.html" title="Class execution_exception">execution_exception</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// member classes/structs/unions</span>

  <span class="comment">// Simple model for the location of failure in a source code.</span>

  <span class="keyword">struct</span> <a class="link" href="execution_exception/location.html" title="Struct location">location</a> <span class="special">{</span>
    <span class="comment">// <a class="link" href="execution_exception/location.html#boost.execution_exception.locationconstruct-copy-destruct">construct/copy/destruct</a></span>
    <span class="keyword">explicit</span> <a class="link" href="execution_exception/location.html#idm44970734639536-bb"><span class="identifier">location</span></a><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">size_t</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">explicit</span> <a class="link" href="execution_exception/location.html#idm44970734636048-bb"><span class="identifier">location</span></a><span class="special">(</span><span class="identifier">const_string</span><span class="special">,</span> <span class="identifier">size_t</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="keyword">char</span> <span class="keyword">const</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>

    <span class="comment">// public data members</span>
    <span class="identifier">const_string</span> <span class="identifier">m_file_name</span><span class="special">;</span>    <span class="comment">// File name. </span>
    <span class="identifier">size_t</span> <span class="identifier">m_line_num</span><span class="special">;</span>    <span class="comment">// Line number. </span>
    <span class="identifier">const_string</span> <span class="identifier">m_function</span><span class="special">;</span>    <span class="comment">// Function name. </span>
  <span class="special">}</span><span class="special">;</span>
  <span class="keyword">enum</span> <a class="link" href="execution_exception/error_code.html" title="Type error_code">error_code</a><span class="special">;</span>
  <span class="comment">// <a class="link" href="execution_exception.html#boost.execution_exceptionconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="execution_exception.html#idm44970734632848-bb"><span class="identifier">execution_exception</span></a><span class="special">(</span><span class="identifier">error_code</span><span class="special">,</span> <span class="identifier">const_string</span><span class="special">,</span> <a class="link" href="execution_exception/location.html" title="Struct location">location</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45283074372544"></a><h2>Description</h2>
<p>The instance of this class is thrown out of execution_monitor::execute invocation when failure is detected. Regardless of a kind of failure occurred the instance will provide a uniform way to catch and report it.</p>
<p>One important design rationale for this class is that we should be ready to work after fatal memory corruptions or out of memory conditions. To facilitate this class never allocates any memory and assumes that strings it refers to are either some constants or live in a some kind of persistent (preallocated) memory. </p>
<div class="refsect2">
<a name="idm45283074371056"></a><h3>
<a name="boost.execution_exceptionconstruct-copy-destruct"></a><code class="computeroutput">execution_exception</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><a name="idm44970734632848-bb"></a><span class="identifier">execution_exception</span><span class="special">(</span><span class="identifier">error_code</span> ec<span class="special">,</span> <span class="identifier">const_string</span> what_msg<span class="special">,</span> 
                    <a class="link" href="execution_exception/location.html" title="Struct location">location</a> <span class="keyword">const</span> <span class="special">&amp;</span> location<span class="special">)</span><span class="special">;</span></pre>Constructs instance based on message, location and error code. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">ec</code></span></p></td>
<td><p>error code </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">location</code></span></p></td>
<td><p>error location </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">what_msg</code></span></p></td>
<td><p>error message </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="execution_aborted.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../header/boost/test/execution_monitor_hpp.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="execution_exception/location.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
